<header class="layout head padding-small">
    <a href="javascript:pageBack();" class="hBack float-left"></a>
    <h4 class="hTxt float-left text-center text-white">确认微信支付</h4>
    <a href="javascript:;" id="btnJdkey" class="hHlep float-right"></a>
</header>
<div align="center" style="padding:20px;">
	<button style=" width:120px; height:40px; font-size:1em; border:0; border-radius:5px; background:#C33;" type="button" onClick="callpay()" >确认支付</button>
</div>

<script type="text/javascript">
	//调用微信JS api 支付
	function jsApiCall()
	{
		WeixinJSBridge.invoke(
			'getBrandWCPayRequest',
			<?php echo $output['jsApiParameters']; ?>,
			function(res){
				WeixinJSBridge.log(res.err_msg);
				window.location.href = 'index.php?act=member_order';
				//alert(res.err_code+res.err_desc+res.err_msg);
			}
		);
	}

	function callpay()
	{
		if (typeof WeixinJSBridge == "undefined"){
			if( document.addEventListener ){
				document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
			}else if (document.attachEvent){
				document.attachEvent('WeixinJSBridgeReady', jsApiCall); 
				document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
			}
		}else{
			jsApiCall();
		}
	}
</script>
